package org.whuims.entity;

import org.apache.solr.client.solrj.beans.Field;
import org.springframework.data.solr.core.mapping.SolrDocument;

import javax.persistence.*;

/**
 * Created by zhongwei on 2017/1/1.
 */
@Entity
@Table(name = "paragraph")
@SolrDocument(solrCoreName = "docs_paragraph")
public class Paragraph extends IdEntity {

    @Field(value = "documentId")
    private Long documentId;
    @Field(value = "content")
    private String content;
    @Field(value = "orderInDocument")
    private Integer orderInDocument;
    @Field(value = "height")
    private Float height;
    @Field(value = "width")
    private Float width;
    @Field(value = "searchFields")
    private String searchFields;
    @Field(value = "userId")
    private Long userId;

    @Basic
    @Column(name = "document_id")
    public Long getDocumentId() {
        return documentId;
    }

    public void setDocumentId(Long documentId) {
        this.documentId = documentId;
    }

    @Basic
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "order_in_document")
    public Integer getOrderInDocument() {
        return orderInDocument;
    }

    public void setOrderInDocument(Integer orderInDocument) {
        this.orderInDocument = orderInDocument;
    }

    @Basic
    public Float getHeight() {
        return height;
    }

    public void setHeight(Float height) {
        this.height = height;
    }

    @Basic
    public Float getWidth() {
        return width;
    }

    public void setWidth(Float width) {
        this.width = width;
    }

    @Transient
    public String getSearchFields() {
        return searchFields;
    }

    public void setSearchFields(String searchFields) {
        this.searchFields = searchFields;
    }

    @Basic
    @Column(name = "user_id")
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }
}
